import Vue from 'vue'
import Router from 'vue-router'
import index from '../components/index/index'
import cart from '../components/cart/cart'
import category from '../components/category/category'
import my from '../components/my/my'
import search from '../components/search/search'
import goodsinfo from '../components/goods/goodsInfo'

Vue.use(Router)

export default new Router({
  // mode: 'history',
  routes: [{
    path: '/',
    redirect: '/index' // 重定向（默认显示首页）
  },
  {
    path: '/index',
    component: index
  }, {
    path: '/cart',
    component: cart
  }, {
    path: '/category',
    component: category
  }, {
    path: '/my',
    component: my
  }, {
    path: '/search',
    component: search
  }, {
    path: '/goodsInfo/:id',
    component: goodsinfo
  }
  ],
  linkActiveClass: 'kl-active'
})
